"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.configKey = exports.key = void 0;
const key_1 = require("./key");
Object.defineProperty(exports, "key", { enumerable: true, get: function () { return key_1.key; } });
const ORIGIN_KEY = key_1.key;
class ConfigKeyClass {
    constructor() {
        this.usedKey = key_1.key;
    }
    checkCustomKey(customKey) {
        if (!customKey) {
            return false;
        }
        if (Object.prototype.toString.call(customKey) !== "[object Array]") {
            return false;
        }
        if (customKey.length <= 10) {
            return false;
        }
        customKey.forEach(v => {
            if (typeof v !== "string") {
                return false;
            }
        });
        return true;
    }
    getKey() {
        return this.usedKey;
    }
    getOriginKey() {
        return ORIGIN_KEY;
    }
    setKey(customKey) {
        if (this.checkCustomKey(customKey)) {
            this.usedKey = customKey;
        }
    }
    resetKey() {
        this.usedKey = ORIGIN_KEY;
    }
}
const configKey = new ConfigKeyClass();
exports.configKey = configKey;
